package com.xli.mybatis.support;

import cn.hutool.crypto.symmetric.AES;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class AesSupport implements Encrypt {


    @Override
    public String encrypt(String plainText, String key) {
        AES aes = new AES(key.getBytes());
        return aes.encryptBase64(plainText);
    }

    @Override
    public String decrypt(String cipherText, String key) {
        AES aes = new AES(key.getBytes());
        return aes.decryptStr(cipherText);
    }
}
